package Version3;

public class Monster {
    private int life;
    private int attack;
    private int expEarned;
    private String name;
    private String job;
    
    public Monster(String s)
    {
        life=150;
        attack=50;
        expEarned=1;
        name=s;
        job="Melee";
    }
    
    public boolean isAlive()
    {
	    if(life<=0)
	        return false;
	    else
	        return true;
    }
    
    public void hurted(int damage)
    {
	    if(life-damage<=0)
	        life=0;
	    else
	        life=life-damage;
    }
    
    public int getExp()
    {
        return expEarned;
    }
    
    public int getLife()
    {
        return life;
    }
    
	public String getName()
	{
	    return name;
	}
	
	public int getAttack()
	{
	    return attack;
	}


	public String getJob()
	{
	    return job;
	}
	public String hurtMH(MonsterHunter mh,Stage stage)
    {
        int damage=stage.computeMonsterDamage(this,mh);;
        String s= this.name+ " attack "+ mh.getName()+"  for " + damage + " life. \n";
        mh.hurt(damage);
        if (!mh.isAlive())
            s=s+mh.getName() + " dead. \n";
        else
            s=s +mh.getName() + " now remains " +mh.getLife()+ " life. \n";
        return s;
    }
}


